package com.example.elastic.document;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

/**
 * @author zxs
 * @since 2022/4/7
 */
@Data
@Document(indexName = "user")
public class User {

    @Id
    private String id;

    @Field(type = FieldType.Date)
    private String birthday;

    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_smart")
    private String username;

    @Field(type=FieldType.Integer)
    private Integer age;

    @Field(type = FieldType.Nested)
    private Address address;

    private Integer random;


}
